#pragma once

#include <string>

#include "monitor/monitor_inter.h"

#include "monitor_info.grpc.pb.h"
#include "monitor_info.pb.h"

namespace monitor
{
    class CpuLoadMonitor : public MonitorInter
    {
    public:
        CpuLoadMonitor() {}
        void UpdateOnce(monitor::proto::MonitorInfo *monitor_info);
        void Stop() override {}

    private:
        // 记录最近1、3、15分钟内的平均负载
        float load_avg_1_;
        float load_avg_3_;
        float load_avg_15_;
    };

    class CpuLoadFactory : public MonitorFactory
    {
    public:
        MonitorInter* CreateMonitor();
    };

} // namespace monitor
